function F = GetFullFeatures(S) % get features of state S for player P
    
    % tiling specifiers
    x_tiles = 8; % 8 tiles
    x_tile_width = 15; % 8*15 = 120 (the width of the pitch)
    
    y_tiles = 4;
    y_tile_width = 15;
    
    distance_tiles = 14; % distance varies between 0 and 135; 14*10 = 140
    distance_tile_width = 10;
    
    angle_tiles = 8; % 8*45 = 360
    angle_tile_width = 45;
    
    num_tilings = 32;
    
    distances_vec = {0 0 0 0 0 0 0 0 0 0};
    angles_vec = {0 0 0 0 0 0 0 0 0 0};
    
    % get the ball object
    B = S{1}; 
    B_X=B{1}(1);
    B_Y=B{1}(2);
    absolute_x = B_X+60; % x ranges from -60 to 60 so normalizing to get a value between 0 and 120
    absolute_y = B_Y + 30; % x ranges from -30 to 30 so normalizing to get a value between 0 and 60
    % obtain features
    
    % distance of ball from goal
    ball_x = xFeatures(absolute_x, num_tilings, x_tiles, x_tile_width);
    offset = num_tilings*(x_tiles+1) - 1;
    
    ball_y = xFeatures(absolute_y, num_tilings, y_tiles, y_tile_width) + offset;
    offset = offset + num_tilings*(y_tiles+1) - 1;
    
    % relative distance and angle from each player to the ball
    for k = 2:numel(S), 
        Pk = S{k};
        Pk_X=Pk{1}(1);
        Pk_Y=Pk{1}(2);
        Pk_theta = Pk{1}(3);
        
        angle=atan2(B_Y-Pk_Y,B_X-Pk_X)/pi*180;    %compute the angle to the ball in degrees
        ang=angle-Pk_theta;  %from heading to ball
        
        if(ang<0)
            while(ang<0), ang=ang+360; end;    %correct the angle
        else while(ang>360), ang=ang-360;end;
        end
        
        Pk_alpha=ang;  % relative angle to the ball
        Pk_R=sqrt((B_Y-Pk_Y)^2+(B_X-Pk_X)^2);  % relative distance to the ball
        
        distances_vec{k-1} = xFeatures(Pk_R, num_tilings, distance_tiles, distance_tile_width) + offset;
        offset = offset + num_tilings*(distance_tiles+1) - 1;
        
        angles_vec{k-1} = xFeatures(Pk_alpha, num_tilings, angle_tiles, angle_tile_width) + offset;
        offset = offset + num_tilings*(angle_tiles+1) - 1;

%         distances_vec{k-1} = xFeatures(Pk_X, num_tilings, x_tiles, x_tile_width) + offset;
%         offset = offset + num_tilings*(x_tiles+1) - 1;
%         
%         angles_vec{k-1} = xFeatures(Pk_Y, num_tilings, y_tiles, y_tile_width) + offset;
%         offset = offset + num_tilings*(y_tiles+1) - 1;
        
    end
    
    F = [ball_x, ball_y, distances_vec{1:(numel(S)-1)}, angles_vec{1:(numel(S)-1)}];
end